home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Interactive 11 / CDROM11.iso / pc / win95 / 1.cab / shared.dir / 00378_MAIN SCRIPTS.ls < prev    next >
Encoding:
Text File  |  1995-06-02  |  12.7 KB  |  569 lines

  1. on InitializeDemo
  2.   global gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gMainMovieName, gIntroTimeOut, gInteractiveTimeout, gOEMTimeout, gResellerTimeout, gDialogTimeout, gTeaserList, gCurrTeaser, gDialogResult, gAutoTestMode, gScanExitFlag, gNoHelp, gTopicList, gCurrTopic, gLastForwardBlink, gLastTextBox, gLastScreen, gCDROMversion, gLastAudio, gAudioPath, gSectionAnimationSpeed, gNextKey, gBackKey, gMenuKey, gRestartKey, gExitKey
  3.   clearGlobals()
  4.   setUpDemo()
  5.   set gAutoTestMode to 0
  6.   set gAutoMode to 0
  7.   set gTeaserMode to 0
  8.   set gMainMovieName to "A95Demo.DIR"
  9.   set gScanExitFlag to 1
  10.   set gLastAudio to EMPTY
  11.   set gTopicList to field "file list"
  12.   set gCurrTopic to 1
  13.   set gTeaserList to field "teaser list"
  14.   set gCurrTeaser to 0
  15.   set gLastForwardBlink to the ticks
  16.   set gDialogResult to EMPTY
  17.   set gLastTextBox to EMPTY
  18.   set gLastScreen to EMPTY
  19.   if the machineType = 256 then
  20.     set the exitLock to 1
  21.   end if
  22. end
  23.  
  24. on showtimeout
  25.   global glasttms
  26.   if glasttms <> the timeoutScript then
  27.     put the timeoutScript
  28.     put the timeoutLength
  29.     set glasttms to the timeoutScript
  30.   end if
  31. end
  32.  
  33. on startMovie
  34.   global gMainMovieName, gAutoMode, gResellerVersion
  35.   if voidp(gAutoMode) then
  36.     InitializeDemo()
  37.   end if
  38.   if the movie <> gMainMovieName then
  39.     setupTopicMovies()
  40.   end if
  41. end
  42.  
  43. on setupTopicMovies
  44.   global gResellerVersion, gCurrCPButton, gCPbuttonIndex, gDontHilite, gSwapResExit
  45.   set gDontHilite to 0
  46.   repeat with x = 23 to 28
  47.     puppetSprite(x, 1)
  48.   end repeat
  49.   if gResellerVersion = 1 then
  50.     set EXRSbutton to 28
  51.   else
  52.     set EXRSbutton to 27
  53.   end if
  54.   set gCurrCPButton to 1
  55.   set gCPbuttonIndex to "24" & RETURN & EXRSbutton & RETURN & "23" & RETURN & "25"
  56.   if gSwapResExit = 1 then
  57.     set the locH of sprite EXRSbutton to 555
  58.     puppetSprite(26, 1)
  59.     set the locH of sprite 26 to -1000
  60.   end if
  61.   updateStage()
  62. end
  63.  
  64. on chooseInteractive
  65.   global gAutoMode, gResellerTimeout, gOEMTimeout, gResellerVersion
  66.   set the timeoutScript to EMPTY
  67.   set gAutoMode to 0
  68.   if gResellerVersion = 1 then
  69.     resetResellerTimeout()
  70.   else
  71.   end if
  72.   go("p1")
  73. end
  74.  
  75. on resetResellerTimeout
  76.   global gResellerTimeout
  77.   set the timeoutLength to gResellerTimeout
  78.   set the timeoutScript to "timeOutResellerDialog"
  79. end
  80.  
  81. on clearTimeout
  82.   set the timeoutScript to EMPTY
  83.   set the timeoutLength to 0
  84. end
  85.  
  86. on chooseAutoDemo
  87.   global gAutoMode, gTeaserMode
  88.   set the timeoutScript to EMPTY
  89.   set gAutoMode to 1
  90.   set gTeaserMode to 0
  91.   if (the frame - 1) = label("introDialog") then
  92.     clearMenuButtons()
  93.   end if
  94.   go("p1")
  95. end
  96.  
  97. on startAutoDemo
  98.   set the timeoutScript to EMPTY
  99.   selectSection("full tour")
  100. end
  101.  
  102. on doIntroAnimation
  103.   clearMenuButtons()
  104.   set the timeoutScript to EMPTY
  105.   go("introAnimation")
  106. end
  107.  
  108. on chooseAutoDemoOLD
  109.   global gAutoMode
  110.   set the timeoutScript to EMPTY
  111.   set gAutoMode to 1
  112.   go("blank")
  113.   selectSection("full tour")
  114. end
  115.  
  116. on chooseTeaserDemo
  117.   global gResellerTimeout, gAutoMode, gTeaserMode, gTeaserList, gCurrTeaser
  118.   set the timeoutScript to EMPTY
  119.   set gAutoMode to 1
  120.   set gTeaserMode to 1
  121.   if (the frame - 1) = label("introDialog") then
  122.     clearMenuButtons()
  123.   end if
  124.   set gCurrTeaser to gCurrTeaser + 1
  125.   if gCurrTeaser > the number of lines in gTeaserList then
  126.     set gCurrTeaser to 1
  127.   end if
  128.   go("p1")
  129. end
  130.  
  131. on startTeaserDemo
  132.   global gAutoMode, gTeaserMode, gTeaserList, gCurrTeaser
  133.   set teaser to line gCurrTeaser of gTeaserList
  134.   selectSection(teaser)
  135. end
  136.  
  137. on setSprites default
  138.   global gCurrDialogButton
  139.   set gCurrDialogButton to default
  140.   puppetSprite(2, 1)
  141.   puppetSprite(3, 1)
  142.   if the castNum of sprite 4 <> 0 then
  143.     puppetSprite(4, 1)
  144.   end if
  145. end
  146.  
  147. on hiliteButton s
  148.   global gDontHilite
  149.   if voidp(s) then
  150.     if gDontHilite = 0 then
  151.       set s to the clickOn
  152.     else
  153.       set gDontHilite to 0
  154.       exit
  155.     end if
  156.   end if
  157.   if the puppet of sprite s = 0 then
  158.     set setPuppet to 1
  159.   else
  160.     set setPuppet to 0
  161.   end if
  162.   set h to the locH of sprite s
  163.   set v to the locV of sprite s
  164.   if setPuppet = 1 then
  165.     puppetSprite(s, 1)
  166.   end if
  167.   set the locH of sprite s to h + 2
  168.   set the locV of sprite s to v + 2
  169.   updateStage()
  170.   wait()
  171.   set the locH of sprite s to h
  172.   set the locV of sprite s to v
  173.   updateStage()
  174.   wait()
  175.   if setPuppet = 1 then
  176.     puppetSprite(s, 0)
  177.   end if
  178. end
  179.  
  180. on menuTransition
  181. end
  182.  
  183. on selectSection section
  184.   global gTopicList, gCurrTopic, gCurrSection, gNoHelp
  185.   hiliteButton()
  186.   set gCurrSection to section
  187.   if (gNoHelp = 1) and ((section = "quick tour") or (section = "customizing")) then
  188.     set gTopicList to field (section & " nohelp")
  189.   else
  190.     set gTopicList to field section
  191.   end if
  192.   set gCurrTopic to 1
  193.   hideChecks()
  194.   clearMenuButtons()
  195.   go(1, line gCurrTopic of gTopicList)
  196. end
  197.  
  198. on goMenu menuNUm
  199.   global gMainMovieName, gCurrSection, gLastScreen, gAutoMode, gResellerVersion
  200.   if gAutoMode = 1 then
  201.     AutoDecisionDialog()
  202.     exit
  203.   end if
  204.   if not voidp(menuNUm) then
  205.     hideChecks()
  206.     if (gResellerVersion = 0) and (menuNUm = 1) then
  207.       go("menu1eu", gMainMovieName)
  208.     else
  209.       go("menu" & string(menuNUm))
  210.     end if
  211.     showChecksMenu(menuNUm)
  212.     exit
  213.   end if
  214.   if "dial msn exchange plug system plus office" contains gCurrSection then
  215.     pushLastScreen()
  216.     if the movie = gMainMovieName then
  217.       menuTransition()
  218.       go("menu3")
  219.     else
  220.       menuTransition()
  221.       go("menu3", gMainMovieName)
  222.     end if
  223.     menuTransition()
  224.     showChecksMenu(3)
  225.   else
  226.     pushLastScreen()
  227.     if the movie = gMainMovieName then
  228.       go("menu2")
  229.     else
  230.       go("menu2", gMainMovieName)
  231.     end if
  232.     menuTransition()
  233.     showChecksMenu(2)
  234.   end if
  235. end
  236.  
  237. on backToLastFrame
  238.   global gLastScreen
  239.   hiliteButton()
  240.   clearMenuButtons()
  241.   set m to gLastScreen
  242.   pushLastScreen()
  243.   if m <> EMPTY then
  244.     if item 2 of m = the movie then
  245.       go(value(item 1 of m))
  246.     else
  247.       go(value(item 1 of m), item 2 of m)
  248.     end if
  249.   end if
  250. end
  251.  
  252. on pushLastScreen
  253.   global gLastScreen
  254.   set frameNo to marker(0)
  255.   set m to the movie
  256.   if m = "W95Demo.EXE" then
  257.     set m to "A95DEMO.DIR"
  258.   end if
  259.   set gLastScreen to frameNo & "," & m
  260. end
  261.  
  262. on goBack
  263.   global gTopicList, gCurrTopic, gAutoMode
  264.   sound stop 2
  265.   if gAutoMode = 1 then
  266.     AutoDecisionDialog()
  267.     exit
  268.   end if
  269.   if the frameLabel contains "start" then
  270.     set gCurrTopic to gCurrTopic - 1
  271.     if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
  272.       goMenu()
  273.     else
  274.       set topic to line gCurrTopic of gTopicList
  275.       go("end", topic)
  276.     end if
  277.   else
  278.     if the frameLabel = "endCoffee" then
  279.       go("coffee")
  280.     else
  281.       go(marker(-1))
  282.       if the frameScript = 451 then
  283.         go(marker(-1))
  284.       end if
  285.     end if
  286.   end if
  287. end
  288.  
  289. on goNext
  290.   global gTopicList, gCurrTopic, gCurrSection, mouseUp, gLastScreen, gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gMainMovieName
  291.   sound stop 2
  292.   if gAutoMode = 1 then
  293.     AutoDecisionDialog()
  294.     exit
  295.   end if
  296.   if the frameLabel = "end" then
  297.     addFinishedTopic(line gCurrTopic of gTopicList)
  298.     set gCurrTopic to gCurrTopic + 1
  299.     if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
  300.       if gCurrSection = "quick tour" then
  301.         set gLastScreen to the frame & "," & the movie
  302.         go("m3d", gMainMovieName)
  303.       else
  304.         goMenu()
  305.       end if
  306.     else
  307.       set topic to line gCurrTopic of gTopicList
  308.       go(1, topic)
  309.     end if
  310.   else
  311.     go(marker(1))
  312.   end if
  313. end
  314.  
  315. on addFinishedTopic finishedTopic
  316.   global gFinishedTopics
  317.   if not (gFinishedTopics contains finishedTopic) then
  318.     put finishedTopic & RETURN after gFinishedTopics
  319.   end if
  320. end
  321.  
  322. on clearMenuButtons
  323.   global gCurrDialogButton
  324.   repeat with s = 9 to 19
  325.     puppetSprite(s, 0)
  326.   end repeat
  327.   puppetSprite(20, 0)
  328.   set gCurrDialogButton to 0
  329. end
  330.  
  331. on setMenuExitButton s
  332.   global gResellerVersion
  333.   puppetSprite(20, 1)
  334.   if gResellerVersion = 1 then
  335.     set the castNum of sprite s to cast "green restart"
  336.   end if
  337.   set the locH of sprite 20 to -1000
  338.   updateStage()
  339. end
  340.  
  341. on setDefaultMenuButton sp
  342.   global gCurrDialogButton
  343.   if voidp(gCurrDialogButton) or (gCurrDialogButton = 0) then
  344.     set gCurrDialogButton to 9
  345.     set lastsprite to gCurrDialogButton
  346.     set gCurrDialogButton to sp
  347.     set c to the castNum of sprite lastsprite
  348.     set the castNum of sprite lastsprite to c - 1
  349.     set c to the castNum of sprite gCurrDialogButton
  350.     set the castNum of sprite gCurrDialogButton to c + 1
  351.   end if
  352. end
  353.  
  354. on showChecksMenu menuNUm
  355.   global gFinishedTopics, gCurrSection
  356.   if voidp(gFinishedTopics) then
  357.     set gFinishedTopics to EMPTY
  358.   end if
  359.   set lastChar to the number of chars in gFinishedTopics
  360.   if char lastChar of gFinishedTopics = RETURN then
  361.     delete char lastChar of gFinishedTopics
  362.   end if
  363.   puppetSprite(41, 1)
  364.   puppetSprite(42, 1)
  365.   puppetSprite(43, 1)
  366.   puppetSprite(44, 1)
  367.   puppetSprite(45, 1)
  368.   puppetSprite(46, 1)
  369.   puppetSprite(47, 1)
  370.   if gFinishedTopics = EMPTY then
  371.   end if
  372.   if gCurrSection <> EMPTY then
  373.   end if
  374.   if menuNUm = 2 then
  375.     if gFinishedTopics contains field "getting" then
  376.       showc(41)
  377.     else
  378.       setDefaultMenuButton(9)
  379.     end if
  380.     if gFinishedTopics contains field "working" then
  381.       showc(42)
  382.     else
  383.       setDefaultMenuButton(10)
  384.     end if
  385.     if gFinishedTopics contains field "organizing" then
  386.       showc(43)
  387.     else
  388.       setDefaultMenuButton(11)
  389.     end if
  390.     if gFinishedTopics contains field "customizing" then
  391.       showc(44)
  392.     else
  393.       setDefaultMenuButton(12)
  394.     end if
  395.   else
  396.     if menuNUm = 3 then
  397.       if gFinishedTopics contains field "dial" then
  398.         showc(41)
  399.       else
  400.         setDefaultMenuButton(9)
  401.       end if
  402.       if gFinishedTopics contains field "exchange" then
  403.         showc(42)
  404.       else
  405.         setDefaultMenuButton(10)
  406.       end if
  407.       if gFinishedTopics contains field "MSN" then
  408.         showc(43)
  409.       else
  410.         setDefaultMenuButton(11)
  411.       end if
  412.       if gFinishedTopics contains field "plug" then
  413.         showc(44)
  414.       else
  415.         setDefaultMenuButton(12)
  416.       end if
  417.       if gFinishedTopics contains field "system" then
  418.         showc(45)
  419.       else
  420.         setDefaultMenuButton(13)
  421.       end if
  422.       if gFinishedTopics contains field "plus" then
  423.         showc(46)
  424.       else
  425.         setDefaultMenuButton(14)
  426.       end if
  427.       if gFinishedTopics contains field "office" then
  428.         showc(47)
  429.       else
  430.         setDefaultMenuButton(15)
  431.       end if
  432.     end if
  433.   end if
  434.   updateStage()
  435. end
  436.  
  437. on hideChecks
  438.   puppetSprite(41, 0)
  439.   puppetSprite(42, 0)
  440.   puppetSprite(43, 0)
  441.   puppetSprite(44, 0)
  442.   puppetSprite(45, 0)
  443.   puppetSprite(46, 0)
  444.   puppetSprite(47, 0)
  445.   updateStage()
  446. end
  447.  
  448. on gop2
  449.   go("p2")
  450. end
  451.  
  452. on goCloser
  453.   global gMainMovieName
  454.   dialogClose()
  455.   go("closer", gMainMovieName)
  456. end
  457.  
  458. on goScan
  459.   go("endSniff", field "scan movie name")
  460. end
  461.  
  462. on doEndCloser
  463.   global gAutoMode, gTeaserMode, gResellerVersion
  464.   if gResellerVersion = 1 then
  465.     set gAutoMode to 0
  466.     set gTeaserMode to 0
  467.     go("black")
  468.   else
  469.     if gResellerVersion = 0 then
  470.       deleteFilesDialog()
  471.     end if
  472.   end if
  473. end
  474.  
  475. on goRestart
  476.   global gMainMovieName
  477.   dialogClose()
  478.   puppetSprite(24, 0)
  479.   if the movie = gMainMovieName then
  480.     go("intro1")
  481.   else
  482.     go("intro1", gMainMovieName)
  483.   end if
  484. end
  485.  
  486. on doDeleteFiles
  487.   if the machineType = 256 then
  488.     doQuit()
  489.   else
  490.     alert("On Windows Machine, Delete Files Here")
  491.   end if
  492. end
  493.  
  494. on doQuit
  495.   global gMainMovieName
  496.   dialogClose()
  497.   quit()
  498. end
  499.  
  500. on skipIntro
  501.   set the mouseDownScript to EMPTY
  502.   if the key = "s" then
  503.     go("skip")
  504.   end if
  505. end
  506.  
  507. on blinkForwardArrow
  508.   global gLastForwardBlink, gCurrCPButton
  509.   if gCurrCPButton = 1 then
  510.     set default to ".dark"
  511.   else
  512.     set default to EMPTY
  513.   end if
  514.   if (the ticks - gLastForwardBlink) > 25 then
  515.     if the castNum of sprite 24 = the number of cast ("next normal" & default) then
  516.       set num to cast ("next blink" & default)
  517.     else
  518.       if the castNum of sprite 24 = the number of cast ("next blink" & default) then
  519.         set num to cast ("next normal" & default)
  520.       end if
  521.     end if
  522.     set the castNum of sprite 24 to num
  523.     updateStage()
  524.     set gLastForwardBlink to the ticks
  525.   end if
  526. end
  527.  
  528. on showNextBtn
  529.   global gLastForwardBlink, gCurrCPButton
  530.   if gCurrCPButton = 1 then
  531.     set default to ".dark"
  532.   else
  533.     set default to EMPTY
  534.   end if
  535.   if the castNum of sprite 24 <> the number of cast ("next normal" & default) then
  536.     set the castNum of sprite 24 to cast ("next normal" & default)
  537.     updateStage()
  538.   end if
  539. end
  540.  
  541. on show s
  542.   set x to the locH of sprite s
  543.   if x < 0 then
  544.     set the locH of sprite s to x + 1000
  545.   end if
  546. end
  547.  
  548. on hide s
  549.   set x to the locH of sprite s
  550.   if x > 0 then
  551.     set the locH of sprite s to x - 1000
  552.   end if
  553. end
  554.  
  555. on showc s
  556.   set x to the locH of sprite s
  557.   if x < 0 then
  558.     set the locH of sprite s to ((x + 1000) * -1) + 5
  559.   end if
  560. end
  561.  
  562. on hidec s
  563.   set w to the width of sprite s / 2
  564.   set x to the locH of sprite s
  565.   if x > 0 then
  566.     set the locH of sprite s to ((x + 1000) * -1) - w
  567.   end if
  568. end
  569.